    <meta charset="UTF-8">
<input type="text">
<ul></ul>
<script type="module">
    import {get} from './ajax.js'
    document.querySelector('input').oninput = function() {
        get('http://www.baidu.com/sugrec',
        {   prod:'pc',
            wd:this.value
        },
            (res)=>{
                document.querySelector('ul').innerText = ''
                if(!res.g) return
                res.g.forEach((item, i) => {
                let liObj = document.createElement('li')
                liObj.innerText = item.q
                document.querySelector('ul').appendChild(liObj)
                })
            },
            'json',)
    }
</script>